//
//  MainViewController.m
//  代码适配
//
//  Created by 郭明皓 on 16/6/22.
//  Copyright © 2016年 郭明皓. All rights reserved.
//

#import "MainViewController.h"
#import "DetailViewController.h"
#import "phoneViewController.h"
#import "usernameViewController.h"
#import "passwordViewController.h"
@interface MainViewController ()
@property (nonatomic, strong)UIImageView *LeftImage;
@property (nonatomic, strong)UIImageView *nameImage;
@property (nonatomic, strong)UIImageView *phoneImage;
@property (nonatomic, strong)UIImageView *usernameImage;
@property (nonatomic, strong)UIImageView *PasswordImage;
@end

@implementation MainViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor colorWithRed:1.00 green:1.00 blue:0.81 alpha:1.00];
    // Do any additional setup after loading the view.
    self.LeftImage = [UIImageView addImgWithFrame:CGRectMake(0, 188 * Height, 97 * Width, 254 * Height) AndImage:@"left"];
    [self.view addSubview:_LeftImage];
    
    
    self.nameImage = [UIImageView addImgWithFrame:CGRectMake(23 * Width, 97 * Height, 82 * Width, 87 * Height) AndImage:@"name"];
    [self.view addSubview:_nameImage];
    self.nameImage.userInteractionEnabled = YES;
    UITapGestureRecognizer *nametap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(nameTapAction:)];
    [self.nameImage addGestureRecognizer:nametap];
    
    self.phoneImage = [UIImageView addImgWithFrame:CGRectMake(112 *Width, 196 * Height, 96 * Width, 96 * Height) AndImage:@"phone"];
    [self.view addSubview:_phoneImage];
    self.phoneImage.userInteractionEnabled = YES;
    UITapGestureRecognizer *phonetap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(phoneTapAction:)];
    [self.phoneImage addGestureRecognizer:phonetap];
    
    self.usernameImage = [UIImageView addImgWithFrame:CGRectMake(120 * Width, 333 * Height, 104 * Width, 101 * Height) AndImage:@"username"];
    [self.view addSubview:_usernameImage];
    self.usernameImage.userInteractionEnabled = YES;
    UITapGestureRecognizer *usernametap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(usernameTapAction:)];
    [self.usernameImage addGestureRecognizer:usernametap];
    
    self.PasswordImage = [UIImageView addImgWithFrame:CGRectMake(36 * Width, 439 * Height, 79 * Width, 88 * Height) AndImage:@"password"];
    [self.view addSubview:_PasswordImage];
    self.PasswordImage.userInteractionEnabled = YES;
    UITapGestureRecognizer *passwordtap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(passwordTapAction:)];
    [self.PasswordImage addGestureRecognizer:passwordtap];
    

}
- (void)nameTapAction:(UITapGestureRecognizer *)nametap
{
    DetailViewController *detail = [[DetailViewController alloc]init];
    [self presentViewController:detail animated:YES completion:^{

    }];
}
- (void)phoneTapAction:(UITapGestureRecognizer *)phonetap
{
    phoneViewController *detail = [[phoneViewController alloc]init];
    [self presentViewController:detail animated:YES completion:^{
        
    }];
}
- (void)usernameTapAction:(UITapGestureRecognizer *)usernametap
{
    usernameViewController *detail = [[usernameViewController alloc]init];
    [self presentViewController:detail animated:YES completion:^{
        
    }];
}
- (void)passwordTapAction:(UITapGestureRecognizer *)passwordtap
{
    passwordViewController *detail = [[passwordViewController alloc]init];
    [self presentViewController:detail animated:YES completion:^{
        
    }];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
